Add support for field name qualification (field names with dots)#51
Open
lowellstewart wants to merge 4 commits intojjwilly16:masterfrom
Open
Add support for field name qualification (field names with dots)#51lowellstewart wants to merge 4 commits intojjwilly16:masterfrom
lowellstewart wants to merge 4 commits intojjwilly16:masterfrom
Conversation
added 4 commits
April 5, 2024 15:40
Unfortunately I did not capture the specific form that caused this failure, but it definitely happened.
(aka partially & fully qualified field names)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The underlying pdftk tool appears to fully support "qualified" field names -- those that include hierarchical parts, separated by periods, such as "section1.personal_info.first_name" -- and this NodeJS wrapper supports reading field info out of PDFs that contain such field names, but it will not FILL a PDF if the PDF's fields have this kind of naming.
This pull request adds the necessary support for filling PDFs that have hierarchical field names. I have included unit tests. Note: I've had this code in production for several years and it has worked very well. Sorry I'm only getting around now to upstreaming my changes. Please let me know if I can do anything to improve the pull req.
Note: I also included a tweak to an error handler. This was in response to a crash that happened once at runtime. Unfortunately I did not manage to capture the situation that triggered the error, although it must have had something to do with UTF8 encoding (specifically, binary sequences of bytes that could not be interpreted as valid UTF8). See the "fix bug in error handler" commit to see what I did there... it's ugly but it protects against whatever went wrong that one time.